package com.xianggu.protocol.server;

import com.xianggu.spring.XiangGuApplicationContent;
import com.xianggu.tomcat.Tomcat;

/**
 * @author chengjy
 * @date 2025/3/8
 */
public class HttpServer {

    public static void start(Class configClass ,  String localhost, int port) {
        // 启动Spring容器，加载bean
        XiangGuApplicationContent applicationContent = new XiangGuApplicationContent(configClass);
        // 创建tomcat
        Tomcat tomcat = new Tomcat(applicationContent);
        // 指定对应的处理任务实现
        tomcat.start(port , new HttpSocketProcessor());
    }
}
